/**
 * 工具函数
//  */
// require("../../fonts/iconfont.css")

//手机号码验证
function isphone(num){
    return /^1[3-9]\d{9}$/.test(num)
}

//接口地址
let BMSE_URL="http://139.9.177.51:8099"
 


// 密码(以字母开头，长度在6~18之间，只能包含字母、数字和下划线)：^[a-zA-Z]\w{5,17}$
function ispassword(num){
    return /^[a-zA-Z]\w{5,17}$/.test(num)
}

//提示框 
function Prompt(tu,text="哈哈哈",time=2000){

    let div=document.createElement("div")
    div.className="Prompt"
    div.innerHTML=`
    <span class="iconfont icon-${tu}"></span>
    <p>${text}</p>
    `
    // console.log(div);
    document.body.appendChild(div)
    setTimeout(function(){
        div.remove()
    },time)
   

}

//页脚导航
function footMenubar( currentPage){
    let div=document.createElement("div")
    div.className="menubar"
    div.innerHTML=`
        <a href="./home.html">
            <span class="iconfont icon-shouye ${currentPage=="home"?"active":""}"></span>
            <p>首页</p>
        </a>
        <a href="./Training.html">
            <span class="iconfont icon-wode-yundongcopy   ${currentPage=="Training"?"active":""}"></span>
            <p>运动</p> 
        </a>
        <a href="./my.html">
            <span class="iconfont icon-wode  ${currentPage=="my"?"active":""}"></span>
            <p>我的</p> 
        </a>
         `
        document.querySelector(".footer").appendChild(div)
        // console.log(div);
}


// module.exports={
//     isphone:isphone
// }

window.$utils={
    isphone:isphone ,
    ispassword:ispassword,
    Prompt:Prompt,
    footMenubar:footMenubar,
    BMSE_URL:BMSE_URL,
}